<!--
 * @FileDescription: 创建项目
 * @Author: 夏世龙
 * @Date: 2021-7-23
 * @LastEditors: 夏世龙
 * @LastEditTime: 2021-7-27 23：52
 -->
<template>
	<el-row>
		<el-tabs v-model="activeName" @tab-click="handleClick" stretch>
			<el-row>
				<el-col :offset="18" :span="4">
					<div id="btn">
						<el-button type="success" @click="Submit">提交</el-button>
						<el-button type="primary" @click="TemporaryStorage">暂存</el-button>
            <el-button type="warning" @click="checkRecord">日志记录</el-button>
					</div>
				</el-col>
			</el-row>
      <!--日志dialog-->
      <el-dialog title="批注信息" :visible.sync="RecordDialog">
        <el-table :data="recordData" >
          <el-table-column property="time" label="日期" width="200" sortable></el-table-column>
          <el-table-column property="gh" label="工号" width="200"></el-table-column>
          <el-table-column property="name" label="操作人"></el-table-column>
          <el-table-column property="state" label="执行操作" width="150"   :formatter="stateFormat"></el-table-column>
          <el-table-column property="message" label="批注"></el-table-column>
        </el-table>
      </el-dialog>
			<!--基本信息合html区域-->
			<el-tab-pane label="基本信息" name="1">
				<div id="projectForm">
					<el-form label-width="120px" :model="project" ref="project" :rules="projectRules"
						class="demo-ruleForm">
						<el-form-item label-width="120px" label="项目名称" prop="pro_name">
							<el-input v-model="project.pro_name" placeholder="请输入项目名" @change="nameRateAxios">
							</el-input>
						</el-form-item>
						<el-form-item label-width="120px" label="所属学院：" prop="pro_department">
							<el-select v-model="project.pro_department" placeholder="请选择">
								<el-option v-for="(item,index) in departments" :key="index" :label="item.depName"
									:value="item.depName">
								</el-option>
							</el-select>
						</el-form-item>
						<el-form-item label-width="120px" label="项目类别：" prop="level_id">
							<el-cascader v-model="project.level_id" :options="levelOptions" :show-all-levels="false"
								:props="{ value:'levelId', label:'levelName',children:'children'}" style="width: 90%;">
							</el-cascader>
						</el-form-item>
						<el-form-item label-width="120px" label="所属分组：" prop="pro_classification">
							<el-select v-model="project.pro_classification" placeholder="请选择">
								<el-option v-for="(item,index) in classification" :key="index"
									:label="item.classify_name" :value="item.classify_name">
								</el-option>
							</el-select>
						</el-form-item>
						<el-form-item label-width="120px" label="结束时间:" prop="pro_enddate">
							<el-date-picker v-model="project.pro_enddate" type="month" value-format="yyyy-MM"
								placeholder="请选择结束时间" :picker-options="pickerOption">
							</el-date-picker>
						</el-form-item>
						<el-form-item label-width="120px" label="E-Mail:" prop="pro_email">
							<el-input v-model="project.pro_email" placeholder="请输入EMail"></el-input>
						</el-form-item>
						<el-form-item label-width="120px" label="电话(办):" prop="pro_telephone">
							<el-input v-model.number="project.pro_telephone" placeholder="请输入电话(办)"></el-input>
						</el-form-item>
						<el-form-item label-width="120px" label="电话(手机):" prop="pro_phone">
							<el-input v-model.number="project.pro_phone" placeholder="请输入电话(手机)"></el-input>
						</el-form-item>
					</el-form>
				</div>
			</el-tab-pane>
			<!--
			*
			*
			*
			*											  工作简历html区域
			*
			*
			*
			-->
			<el-tab-pane label="工作简历" name="2">
				<el-dialog title="主要工作简历" :visible.sync="dialogResume" :close-on-click-modal="false">
					<el-form :model="resumeData" ref="resumeData" class="demo-ruleForm">
						<el-row>
							<el-col :span="12">
								<el-form-item label="课程名称:" :label-width="formLabelWidth" prop="teachingCoursename"
									:rules="[{ required: true, message: '课程名称不能为空!'}]">
									<el-input v-model="resumeData.teachingCoursename" autocomplete="off"
										placeholder="请输入课程名称"></el-input>
								</el-form-item>
								<el-form-item label="起始时间:" :label-width="formLabelWidth" prop="teachingDateStart"
									:rules="[{ required: true, message: '起始时间不能为空！'}]">
									<el-date-picker v-model="resumeData.teachingDateStart" type="month"
										value-format="yyyy-MM" placeholder="请选择起始时间"
										:picker-options="resumeDataTeachingStart">
									</el-date-picker>
								</el-form-item>
								<el-form-item label="授课对象:" :label-width="formLabelWidth" prop="teachingPrelectobject"
									:rules="[{ required: true, message: '授课对象不能为空！'}]">
									<el-input v-model="resumeData.teachingPrelectobject" autocomplete="off"
										placeholder="请输入授课对象"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="所在单位:" :label-width="formLabelWidth" prop="teachingDepartment"
									:rules="[{ required: true, message: '所在单位不能为空！'}]">
									<el-input v-model="resumeData.teachingDepartment" autocomplete="off"
										placeholder="请输入所在单位"></el-input>
								</el-form-item>
								<el-form-item label="结束时间:" :label-width="formLabelWidth" prop="teachingDateEnd"
									:rules="[{ required: true, message: '结束时间不能为空！'}]">
									<el-date-picker v-model="resumeData.teachingDateEnd" type="month"
										value-format="yyyy-MM" placeholder="请选择结束时间"
										:picker-options="resumeDataTeachingEnd">
									</el-date-picker>
								</el-form-item>
								<el-form-item label="学时:" :label-width="formLabelWidth" prop="teachingLearnhour"
									:rules="[{ required: true, message: '学时不能为空'},{ type: 'number', message: '学时必须为数字值'}]">
									<el-input v-model.number="resumeData.teachingLearnhour" autocomplete="off"
										placeholder="请输入学时"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="dialogResume=false">取 消</el-button>
						<el-button type="primary" @click="confirmResumeSubmit">确 定</el-button>
					</div>
				</el-dialog>

				<div id="ResumeForm">
					<el-button type="primary" @click="resumeAddAndEdit(null)">添加</el-button>
					<el-table :data="resumeAllData" style="width: 100%" border
						:header-cell-style="{background:'#eef1f6',color:'#606266'}">
						<el-table-column label="时间" align="center">
							<template slot-scope="scope">
								<i class="el-icon-time"></i>
								<span
									style="margin-left: 10px">{{ scope.row.teachingDateStart }}至{{ scope.row.teachingDateEnd }}</span>
							</template>
						</el-table-column>
						<el-table-column label="课程名称" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.teachingCoursename }}</span>
							</template>
						</el-table-column>
						<el-table-column label="授课对象" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.teachingPrelectobject }}</span>
							</template>
						</el-table-column>
						<el-table-column label="学时" width="80" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.teachingLearnhour }}</span>
							</template>
						</el-table-column>
						<el-table-column label="所在单位" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.teachingDepartment }}</span>
							</template>
						</el-table-column>
						<el-table-column label="操作" align="center">
							<template slot-scope="scope">
								<el-button size="mini" @click="resumeAddAndEdit(scope.row)">编辑</el-button>
								<el-button size="mini" type="danger" @click="deleteResume(scope.$index, scope.row)">删除
								</el-button>
							</template>
						</el-table-column>
					</el-table>
				</div>
			</el-tab-pane>

			<!--
		      *
			  *
			  *											科研与教研工作简历html区域
			  *
			  *
			-->
			<el-tab-pane label="科研与教研工作简历" name="3">
				<el-dialog title="主要科学研究和教学研究工作简历" :visible.sync="dialogResearching" :close-on-click-modal="false" @close="pdffileList=[]">
					<el-form :model="ResearchResumeData" ref="ResearchResumeData" class="demo-ruleForm">
						<el-row>
							<el-col :span="24">
								<el-form-item label="项目名称:" :label-width="formLabelWidth" prop="searchingName"
									:rules="[{ required: true, message: '项目名称不能为空!'}]">
									<el-input v-model="ResearchResumeData.searchingName" autocomplete="off"
										placeholder="请输入项目名称" style="width: 96%;"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="起始时间:" :label-width="formLabelWidth" prop="searchingDateStart"
									:rules="[{ required: true, message: '起始时间不能为空！'}]">
									<el-date-picker v-model="ResearchResumeData.searchingDateStart" type="month"
										value-format="yyyy-MM" placeholder="请选择起始时间" :picker-options="researchResumeDateStart">
									</el-date-picker>
								</el-form-item>
								<el-form-item label="项目来源" :label-width="formLabelWidth" prop="searchingSource"
									:rules="[{ required: true, message: '项目来源不能为空！'}]">
									<el-input v-model="ResearchResumeData.searchingSource" autocomplete="off"
										placeholder="请输入项目来源"></el-input>
								</el-form-item>
								<el-form-item label="获奖情况:" :label-width="formLabelWidth" prop="searchingAwards"
									:rules="[{ required: true, message: '获奖情况不能为空！'}]">
									<el-input v-model="ResearchResumeData.searchingAwards" autocomplete="off"
										placeholder="请输入获奖情况"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">

								<el-form-item label="结束时间:" :label-width="formLabelWidth" prop="searchingDateEnd"
									:rules="[{ required: true, message: '结束时间不能为空！'}]">
									<el-date-picker v-model="ResearchResumeData.searchingDateEnd" type="month"
										value-format="yyyy-MM" placeholder="请选择结束时间" :picker-options="researchResumeDateEnd">
									</el-date-picker>
								</el-form-item>

								<el-form-item label="项目状态:" :label-width="formLabelWidth" prop="searchingSearchstatus"
									:rules="[{ required: true, message: '项目状态不能为空！'}]">
									<el-input v-model="ResearchResumeData.searchingSearchstatus" autocomplete="off"
										placeholder="请输入项目状态"></el-input>
								</el-form-item>

								<el-form-item label="佐证材料:" :label-width="formLabelWidth" prop="searchingMaterials">
									<el-upload class="upload-demo" :action="base_Url+'/file/fileUpload'"
										:on-preview="handlePreview" :on-remove="RemovePdf"
										:before-upload="pdfbeforeUpload" :before-remove="beforeRemove"
										:limit="1" :on-exceed="handleExceed" :headers="headerObj"
										:on-success="pdfUploadSuccess" accept=".pdf" :file-list="pdffileList">
										<el-button size="small" type="primary">点击上传PDF</el-button>
									</el-upload>
								</el-form-item>
							</el-col>
						</el-row>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="dialogResearching=false;pdffileList=[]">取 消</el-button>
						<el-button type="primary" @click="confirmreSearchResumeSubmit">确 定</el-button>
					</div>
				</el-dialog>

				<!--表单区域-->
				<div id="ResumeForm">
					<el-button type="primary" @click="researchResumeAddAndEdit(null)">添加</el-button>
					<el-table :data="ResearchResumeAllData" style="width: 100%" border
						:header-cell-style="{background:'#eef1f6',color:'#606266'}">
						<el-table-column label="时间" align="center">
							<template slot-scope="scope">
								<i class="el-icon-time"></i>
								<span
									style="margin-left: 10px">{{ scope.row.searchingDateStart}}至{{ scope.row.searchingDateEnd}}</span>
							</template>
						</el-table-column>
						<el-table-column label="项目名称" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.searchingName }}</span>
							</template>
						</el-table-column>
						<el-table-column label="项目来源" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.searchingSource }}</span>
							</template>
						</el-table-column>
						<el-table-column label="项目状态" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.searchingSearchstatus }}</span>
							</template>
						</el-table-column>
						<el-table-column label="获奖情况" width="100" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.searchingAwards }}</span>
							</template>
						</el-table-column>
						<el-table-column label="佐证材料" width="100" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px" v-if="scope.row.searchingMaterials==''">未上传</span>
								<span style="margin-left: 10px" v-else>已上传</span>
							</template>
						</el-table-column>
						<el-table-column label="操作" align="center" width="180px">
							<template slot-scope="scope">
								<el-button size="mini" @click="researchResumeAddAndEdit(scope.row)">编辑
								</el-button>
								<el-button size="mini" type="danger"
									@click="deleteResearchResume(scope.$index, scope.row)">删除
								</el-button>
							</template>
						</el-table-column>
					</el-table>
				</div>
			</el-tab-pane>

			<!--项目主要成员html区域-->
			<el-tab-pane label="项目主要成员" name="4">
				<el-dialog title="项目主要成员" :visible.sync="dialogAddNainMember" width="70%" :close-on-click-modal="false" @close="pngfileList=[]">
					<!--添加主要科学研究和教学研究工作简历弹出层-->
					<el-form :model="mainMember" ref="mainMember" class="demo-ruleForm" :rules="mainMemberRules">
						<el-row>
							<!--搜索区域-->
							<el-col :span="8">
								<el-table
									:data="tableData.filter(data => !search || data.xm.toLowerCase().includes(search.toLowerCase()))"
									style="width: 100%" height="310px">

									<el-table-column align="right">
										<template slot="header" slot-scope="scope">
											<el-input v-model="search" size="mini" placeholder="输入关键字搜索" />
										</template>
										<el-table-column label="工号" prop="gh">
										</el-table-column>
										<el-table-column label="姓名" prop="xm">
										</el-table-column>
										<el-table-column label="部门" prop="bm">
										</el-table-column>
										<el-table-column label="操作" align="center">
											<template slot-scope="scope">
												<el-button size="mini" @click="addTeacherToForm(scope.$index,scope.row)"
													style="width: 100%;" type="primary">添加 </el-button>
											</template>
										</el-table-column>
									</el-table-column>
								</el-table>
							</el-col>
							<el-col :span="8">
								<el-form-item label="姓名:" :label-width="formLabelWidth" prop="memberName"
									:rules="[{ required: true, message: '姓名不能为空!'}]">
									<el-input v-model="mainMember.memberName" autocomplete="off" placeholder="请输入姓名">
									</el-input>
								</el-form-item>

								<el-form-item label="身份证号:" :label-width="formLabelWidth" prop="idcard">
									<el-input v-model="mainMember.idcard" autocomplete="off" placeholder="请输入身份证号">
									</el-input>
								</el-form-item>

								<el-form-item label="专业技术职称:" :label-width="formLabelWidth" prop="memberTitle"
									:rules="[{ required: true, message: '专业技术职称不能为空!'}]">
									<el-input v-model="mainMember.memberTitle" autocomplete="off"
										placeholder="请输入专业技术职称"></el-input>
								</el-form-item>

								<el-form-item label="职务:" :label-width="formLabelWidth" prop="memberJob"
									:rules="[{ required: true, message: '职务不能为空!'}]">
									<el-input v-model="mainMember.memberJob" autocomplete="off" placeholder="请输入职务">
									</el-input>
								</el-form-item>

								<el-form-item :label-width="formLabelWidth">
									<el-input v-model="mainMember.belong" autocomplete="off" placeholder="请输入工号"
										type="hidden">
									</el-input>
								</el-form-item>
							</el-col>


							<el-col :span="8">
								<el-form-item label="所在部门" :label-width="formLabelWidth" prop="memberDep"
									:rules="[{ required: true, message: '所在部门不能为空!'}]">
									<el-input v-model="mainMember.memberDep" autocomplete="off" placeholder="请输入所在部门">
									</el-input>
								</el-form-item>

								<el-form-item label="主要教学科学领域:" :label-width="formLabelWidth" prop="memberResearchareas"
									:rules="[{ required: true, message: '主要教学科学领域不能为空!'}]">
									<el-input v-model="mainMember.memberResearchareas" autocomplete="off"
										placeholder="请输入主要教学科学领域"></el-input>
								</el-form-item>

								<el-form-item label="项目中的分工:" :label-width="formLabelWidth" prop="memberDivision"
									:rules="[{ required: true, message: '项目中的分工不能为空!'}]">
									<el-input v-model="mainMember.memberDivision" autocomplete="off"
										placeholder="请输入项目中的分工"></el-input>
								</el-form-item>

								<el-form-item label="签字:" :label-width="formLabelWidth" :rules="[{ required: true}]">
									<el-upload class="upload-demo" :action="base_Url+'/file/fileUpload'"
										:before-upload="pngbeforeUpload" :on-preview="handlePreview"
										:file-list="pngfileList"
										:on-remove="RemovePng" :before-remove="beforeRemove"  :limit="1"
										:on-exceed="handleExceed" :on-success="pngUploadSuccess" :headers="headerObj"
										accept='.png'>
										<el-button size="small" type="primary">点击上传PNG</el-button>
									</el-upload>
								</el-form-item>
							</el-col>
						</el-row>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="dialogAddNainMember = false;pngfileList=[]">取 消</el-button>
						<el-button type="primary" @click="confirmreMainMemberSubmit">确 定</el-button>
					</div>
				</el-dialog>

				<div id="ResumeForm">
					<el-button type="primary" @click="mainMemeberAddAndEdit(null)">添加</el-button>
					<el-table :data="mainMemberaAll" style="width: 100%" border
						:header-cell-style="{background:'#eef1f6',color:'#606266'}">
						<el-table-column label="姓名" align="center" width="90px">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.memberName }}</span>
							</template>
						</el-table-column>
						<el-table-column label="身份证号" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.idcard }}</span>
							</template>
						</el-table-column>
						<el-table-column label="专业技术职称" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.memberTitle }}</span>
							</template>
						</el-table-column>
						<el-table-column label="职务" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.memberJob }}</span>
							</template>
						</el-table-column>
						<el-table-column label="所在部门" width="100" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.memberDep }}</span>
							</template>
						</el-table-column>

						<el-table-column label="项目中的分工" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.memberDivision }}</span>
							</template>
						</el-table-column>

						<el-table-column label="主要教学科学领域" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px">{{ scope.row.memberResearchareas }}</span>
							</template>
						</el-table-column>

						<el-table-column label="签字" width="80" align="center">
							<template slot-scope="scope">
								<span style="margin-left: 10px" v-if="scope.row.memberSignature==''">未添加</span>
								<span style="margin-left: 10px" v-else>已添加</span>
							</template>
						</el-table-column>
						<el-table-column label="操作" align="center" width="180px">
							<template slot-scope="scope">
								<el-row>
									<el-button size="mini" @click="upLayer(scope.$index,scope.row)"
										style="width: 100%;">上移</el-button>
								</el-row>
								<el-row>
									<el-button size="mini" type="warning"
										@click="mainMemeberAddAndEdit(scope.row)" style="width: 100%;">编辑
									</el-button>
								</el-row>
								<el-row>
									<el-button size="mini" type="danger"
										@click="DeleteMainMember(scope.$index, scope.row)" style="width: 100%;">删除
									</el-button>
								</el-row>
								<el-row>
									<el-button size="mini" @click="downLayer(scope.$index,scope.row)"
										style="width: 100%;">下移 </el-button>
								</el-row>
							</template>
						</el-table-column>

					</el-table>
				</div>
			</el-tab-pane>


			<!--项目的立项依据和目标富文本区域-->
			<el-tab-pane label="项目的立项依据和目标" name="5">
				<div id="RichText">
					<div>
						<p>1.本项目的现状与存在问题的分析</p>
						<quill-editor v-model="proAnalysis" :options="editorOption"> </quill-editor>
					</div>

					<div>
						<p>2.本项目的改革研究内容、主要特色和要解决的关键问题</p>
						<quill-editor v-model="proProblem" :options="editorOption"> </quill-editor>
					</div>

					<div>
						<p>3.本项目改革研究的预期成果</p>
						<quill-editor v-model="proExpection" :options="editorOption"> </quill-editor>
					</div>

					<div>
						<p>4.本项目的改革研究的总体安排及进度</p>
						<quill-editor v-model="proArrange" :options="editorOption"> </quill-editor>
					</div>

					<div>
						<p>5.已有的工作基础、条件及前期已有工作成果</p>
						<quill-editor v-model="proResults" :options="editorOption"> </quill-editor>
					</div>
				</div>
			</el-tab-pane>
			<el-tab-pane label="PDF预览生成" name="6">
			<el-button type="danger"
				@click="GeneratePdf(htmlTitle)">导出PDF</el-button>
				<table id="pdfGen" align="center" width="700">
				<h1 align="center"><strong>辽东学院教育教学改革与研究项目 </strong></h1>
				<h2 align="center"><strong>申   请   表 </strong></h2>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<table width="304" height="276" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
					<tr>
						<td>项目名称：</td>
						<td>{{project.pro_name}}</td>
					</tr>
					<tr v-for="(item,index) in mainMemberaAll" v-if="index==0">
						<td>项目主持人：</td>
						<td>{{item.memberName}}</td>
					</tr>
					<tr>
						<td>所属类别：</td>
						<td>{{getCategory()}}</td>
					</tr>
					<tr>
						<td>所在单位：</td>
						<td>{{project.pro_department}}</td>
					</tr>
					<tr>
						<td>电话（办）：</td>
						<td>{{project.pro_telephone}}</td>
					</tr>
					<tr>
						<td>E-mail：</td>
						<td>{{project.pro_email}}</td>
					</tr>
					<tr>
						<td>填表日期：</td>
						<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年&nbsp;&nbsp;&nbsp;&nbsp;月&nbsp;&nbsp;&nbsp;&nbsp;日</td>
					</tr>
					</table>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center"><strong>辽东学院教务处</strong></p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p align="center">&nbsp;</p>
				<p>&nbsp;</p>
									<p align="left">一、基本情况 </p>
				<table width="650" height="900" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" class="SongFont">
				<tr>
					<td colspan="2" align="center" valign="middle">项目名称</td>
					<td colspan="11" align="center" valign="middle">{{project.pro_name}}</td>
				</tr>
				<tr>
					<td colspan="2" align="center" valign="middle">所属类别</td>
					<td colspan="11" align="center" valign="middle">{{getCategory()}}</td>
				</tr>
				<tr>
					<td colspan="2" align="center" valign="middle">起止年月</td>
					<td colspan="11" align="center" valign="middle">{{nowDate}}至{{project.pro_enddate}}</td>
				</tr>
				<tr v-for="(item,index) in mainMemberaAll" v-if="index==0">
					<td width="19" rowspan="13" align="center" valign="middle"><p>项</p>
					<p>目</p>
					<p>主</p>
					<p>持</p>
					<p>人</p>
          </td>
					<td width="65" align="center" valign="middle">姓 名</td>
					<td colspan="3" align="center" valign="middle">{{item.memberName}}</td>
					<td width="36" align="center" valign="middle">性<br />
					别</td>
					<td width="28" align="center" valign="middle">{{Sex}}</td>
					<td width="49" align="center" valign="middle">职称</td>
					<td width="69" align="center" valign="middle">{{item.memberTitle}}</td>
					<td width="45" align="center" valign="middle">现 任职 务</td>
					<td colspan="3" align="center" valign="middle">{{item.memberJob}}</td>
				</tr>
				<tr>
					<td rowspan="6" align="center" valign="middle"><p align="center">主要教学工作简历 </p></td>
					<td colspan="4" align="center" valign="middle">时间</td>
					<td colspan="3" align="center" valign="middle">课程名称</td>
					<td align="center" valign="middle">授 课对 象</td>
					<td width="30" align="center" valign="middle">学时</td>
					<td colspan="2" align="center" valign="middle">所在单位</td>
				</tr>
				<tr v-for="rAD in resumeAllData">
					<td colspan="4" align="center" valign="middle">{{rAD.teachingDateStart}}至{{rAD.teachingDateEnd}}</td>
					<td colspan="3" align="center" valign="middle">{{rAD.teachingCoursename}}</td>
					<td align="center" valign="middle">{{rAD.teachingPrelectobject}}</td>
					<td align="center" valign="middle">{{rAD.teachingLearnhour}}</td>
					<td colspan="2" align="center" valign="middle">{{rAD.teachingDepartment}}</td>
				</tr>
				<tr v-for="rowNumber in 5 - resumeAllData.length">
					<td colspan="4" align="center" valign="middle">&nbsp;</td>
					<td colspan="3" align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
					<td colspan="2" align="center" valign="middle">&nbsp;</td>
				</tr>
				<tr>
					<td rowspan="6" align="center" valign="middle"><p align="center">主要科学研究和教学研究工作简历</p></td>
					<td colspan="4" align="center" valign="middle">时间</td>
					<td colspan="2" align="center" valign="middle">项目名称</td>
					<td align="center" valign="middle">项目来源</td>
					<td colspan="3" align="center" valign="middle">主要鉴定意见</td>
					<td width="64" align="center" valign="middle">获奖情况</td>
				</tr>
				<tr v-for="rRAD in ResearchResumeAllData">
					<td colspan="4" align="center" valign="middle">{{rRAD.searchingDateStart}}至{{rRAD.searchingDateEnd}}</td>
					<td colspan="2" align="center" valign="middle">{{rRAD.searchingName}}</td>
					<td align="center" valign="middle">{{rRAD.searchingSource}}</td>
					<td colspan="3" align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">{{rRAD.searchingAwards}}</td>
				</tr>
				<tr v-for="rowNumber in 5 - ResearchResumeAllData.length">
					<td colspan="4" align="center" valign="middle">&nbsp;</td>
					<td colspan="2" align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
					<td colspan="3" align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
				</tr>
				<tr>
					<td rowspan="6" align="center" valign="middle">项<br />
					目<br />
					组<br />
					主<br />
					要<br />
					成<br />
					员</td>
					<td align="center" valign="middle">姓名</td>
					<td width="51" align="center" valign="middle">年龄</td>
					<td colspan="4" align="center" valign="middle">专业技<br />
					术职称</td>
					<td align="center" valign="middle">职务</td>
					<td align="center" valign="middle">所在部门</td>
					<td colspan="2" align="center" valign="middle">主要教学<br />
				科研领域</td>
					<td width="48" align="center" valign="middle">项目中<br />
				的分工</td>
					<td align="center" valign="middle">签字</td>
				</tr>
				<tr v-for="mMA in mainMemberaAll">
					<td align="center" valign="middle">{{mMA.memberName}}</td>
					<td colspan="2" align="center" valign="middle">{{getAge(mMA.idcard)}}</td>
					<td colspan="3" align="center" valign="middle">{{mMA.memberTitle}}</td>
					<td align="center" valign="middle">{{mMA.memberJob}}</td>
					<td align="center" valign="middle">{{mMA.memberDep}}</td>
					<td colspan="2" align="center" valign="middle">{{mMA.memberResearchareas}}</td>
					<td align="center" valign="middle">{{mMA.memberDivision}}</td>
					<td align="center" valign="middle"><img :src="'/img' + mMA.memberSignature.substr(6)" width="80"/></td>
				</tr>
				<tr v-for="rowNumber in 5 - mainMemberaAll.length">
					<td align="center" valign="middle">&nbsp;</td>
					<td colspan="2" align="center" valign="middle">&nbsp;</td>
					<td colspan="3" align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
					<td colspan="2" align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
					<td align="center" valign="middle">&nbsp;</td>
				</tr>
				</table>
									<p align="left">二、项目的立项依据和目标 </p>
				<table width="650" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
				<tr>
					<td width="566" height="100" align="left" valign="top">1．本项目的现状与存在问题分析（不少于500字） <br />
					<p><span v-html="proAnalysis"></span></p>
					</td>
				</tr>
				<tr>
					<td height="102" align="left" valign="top">2．本项目的改革研究内容、主要特色和要解决的关键问题（不少于2000字）
					<p><span v-html="proProblem"></span></p>
					</td>
				</tr>
				<tr>
					<td height="104" align="left" valign="top">3．本项目改革研究的预期成果（不少于500字）
					<p><span v-html="proExpection"></span></p>
					</td>
				</tr>
				<tr>
					<td height="104" align="left" valign="top">4．本项目的改革研究的总体安排及进度（不少于500字）
					<p><span v-html="proArrange"></span></p>
					</td>
				</tr>
				<tr>
					<td height="122" align="left" valign="top">5．已有的工作基础、条件及前期已有工作成果（不少于500字）
					<p><span v-html="proResults"></span></p>
					</td>
				</tr>
				</table>
				<br />
				<p align="left">三、所在单位教学工作委员会意见 </p>
				<table width="650" align="center" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
				<tr>
					<td align="left"><p>&nbsp;</p>
					<p>&nbsp;</p>
					<p>&nbsp;</p>
					<p>&nbsp;</p>
					<p align="right">签    章 &nbsp;&nbsp;</p>
					<p align="right">年    月    日</p></td>
				</tr>
				</table>
				<p align="left">四、学校审批意见 </p>
				<table width="650" align="center" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
				<tr>
					<td align="left"><p>&nbsp;</p>
					<p>&nbsp;</p>
					<p>&nbsp;</p>
					<p>&nbsp;</p>
					<p align="right">签    章 &nbsp;&nbsp;</p>
					<p align="right">年    月    日</p></td>
				</tr>
				</table>
				</table>
			</el-tab-pane>
		</el-tabs>
		</el-col>


	</el-row>
</template>

<script>
	import Quill from 'quill';
	import "quill/dist/quill.core.css";
	import "quill/dist/quill.snow.css";
	import ImageResize from 'quill-image-resize-module';
	Quill.register('modules/imageResize', ImageResize);
	export default {
    created() {

    },
		mounted() {
      this.teacherinfo = this.$store.state.info
      this.getDataAxios()
      this.getNowDate()
		},
		data() {
			var validateNewidcard= (rule, value, callback) => {
				if (!value) {
					callback(new Error('请输入您的身份证号码'))
				} else {
					if (value.length==18) {
						callback()
					} else {
						return callback(new Error('请输入18位身份证号码'))
					}
				}
			};
			//验证基本信息表单
			var validateNewEmail = (rule, value, callback) => {
				if (!value) {
					callback(new Error('请输入您的邮箱'))
				} else {
					const mal = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
					if (mal.test(value)) {
						callback()
					} else {
						return callback(new Error('请输入正确邮箱'))
					}
				}
			};
			return {
        base_Url:process.env.Base_API,
        proApproval:'',
        recordData:[],
        RecordDialog:false,
				Sex:'',
				proId:'',
				//png回显
				pngfileList:[],
				//pdf回显
				pdffileList:[],
				batchLevelId: '',
				tableData: [],
				search: '',
				//级别选择项
				levelOptions: [],
				//临时下标
				tempIndex: '',
				//项目问题分析
				proAnalysis: '',
				//项目存在的问题(副文本形式)
				proProblem: '',
				//项目预期成果(副文本形式)
				proExpection: '',
				//项目总体安排及进度(副文本形式)
				proArrange: '',
				//项目已有的工作成果(副文本形式)
				proResults: '',
				//当前日期
				nowDate: '',
				//项目类别
				proCategory: '委托项目',
				//本教师信息
				teacherinfo: {},
				//批次Id
				batch_id: '',
				formLabelWidth: '120px',
				dialogResearching: false, //教学研究添加弹出框
				dialogResume: false,
				//添加主要成员弹出层条件
				dialogAddNainMember: false,
				//修改主要成员弹出层条件
				dialogEditNainMember: false,
				//基本信息页面数组
				resumeData: {
					proId:'',
					id:'',//前端用于增删改查的id
					teachingId:'',//项目id
					teachingDate: "",
					teachingDateStart: "", //授课开始时间
					teachingDateEnd: "", //授课结束时间
					teachingCoursename: "", //课程名称
					teachingPrelectobject: "", //授课对象
					teachingLearnhour: "", //学时
					teachingDepartment: "", //所在单位
				},
				noIdResumeData:[],
				resumeAllData: [],
				ResearchResumeData: { //科研与教研工作简历
					id:'',
					proId:'',//项目Id
					searchingId:'',
					searchingDateStart: '', //科研与教研工作简历开始时间
					searchingDateEnd: '', //科研与教研工作简历结束时间
					searchingName: '', //项目名称
					searchingSource: '', //项目来源
					searchingSearchstatus: '', //项目状态
					searchingAwards: '', //获奖情况
					searchingMaterials: '' //佐证材料(仅保留路径)
				},
				deleteResearchResumeId:[],
				ResearchResumeAllData: [],
				mainMember: {
					id:'',
					proId:'',//项目Id
					memberId:'',
					memberName: '',
					belong: '',
					idcard: '',
					memberTitle: '',
					memberJob: '',
					memberDep: '',
					memberResearchareas: '',
					memberDivision: '',
					memberSignature: '',
					ranking: ''
				},
				deleteMainMemberaId:[],
				mainMemberaAll: [],
				//工作简历时间选择器联动
				resumeDataTeachingStart: {
					disabledDate: (time) => {
						if (this.resumeData.teachingDateEnd == "") {
							return time.getTime() > Date.now()
						} else {
							return time.getTime() >= new Date(this.resumeData.teachingDateEnd)
						}
					},
				},
				resumeDataTeachingEnd: {
					disabledDate: (time) => {
						return time.getTime() <= new Date(this.resumeData.teachingDateStart) || time.getTime() >
							new Date()
					},
				},
				//科研简历时间选择器联动
				researchResumeDateStart: {
					disabledDate: (time) => {
						if (this.ResearchResumeData.searchingDateEnd == "") {
							return time.getTime() > Date.now()
						} else {
							return time.getTime() >= new Date(this.ResearchResumeData.searchingDateEnd)
						}
					},
				},
				researchResumeDateEnd: {
					disabledDate: (time) => {
						return time.getTime() <= new Date(this.ResearchResumeData.searchingDateStart) || time.getTime() >
							new Date()
					},
				},
				pickerOption: {
					disabledDate: (time) => {
						return time.getTime() < Date.now() + 30 * 24 * 60 * 60 * 1000;
					},
				},
				mainMemberRules: {
					idcard: [{
						required: true,
						validator:validateNewidcard,
						trigger: 'blur'
					}]},
				projectRules: {
					pro_name: [{
						required: true,
						message: '请输入项目名称！',
						trigger: 'blur'
					}],
					pro_department: [{
						required: true,
						message: '请选择活动区域',
						trigger: 'change'
					}],
					pro_classification: [{
						required: true,
						message: '请选择活动区域',
						trigger: 'change'
					}],
					pro_enddate: [{
						required: true,
						message: '请选择结束时间',
						trigger: 'blur'
					}],
					pro_email: [{
						required: true,
						validator: validateNewEmail,
						trigger: "blur"
					}],
					pro_telephone: [{
						required: true,
						message: '请输入电话号码！',
						trigger: 'blur'
					},{
						type:"number",
						required: true,
						message: '电话号码必须为数字！',
						trigger: 'blur'
					}],
					pro_phone: [{
						required: true,
						message: '请输入手机电话号码！',
						trigger: 'blur'
					},{
						type:"number",
						required: true,
						message: '手机电话号码必须为数字！',
						trigger: 'blur'
					}],
					level_id: [{
						required: true,
						message: '请选择项目类别！',
						trigger: 'blur'
					}]
				},
				activeName: "1",
				project: {
					pro_id: "",
					pro_name: "",
					pro_approval: 0,
					pro_classification: "",
					pro_subject: "",
					pro_telephone: "",
					pro_phone: "",
					pro_email: "",
					pro_startdate: "",
					pro_enddate: "",
					pro_analysis: "",
					pro_problem: "",
					pro_expection: "",
					pro_arrange: "",
					pro_results: "",
					pro_committee: "",
					committee_date: "",
					pro_experts: "",
					experts_date: "",
					pro_school: "",
					school_date: "",
					pro_department: "",
					pro_dep_id: "",
					create_date: "",
					department_score: "",
					delay_cause: "",
					level_id: ''
				},
				//部门
				departments: [],
				//所属分组
				classification: [],
				//图片上传组件的headers请求头对象
				headerObj: {
					token: this.$store.state.token,
					tokenHead: this.$store.state.tokenHead,
					jsession_id: this.$store.state.jsession_id
				},
				editorOption:{
				    modules:{
				        imageResize: {},
						toolbar:[
				            ['bold', 'italic', 'underline', 'strike'],
				            ['blockquote', 'code-block'],

				            [{ 'header': 1 }, { 'header': 2 }],
				            [{ 'list': 'ordered'}, { 'list': 'bullet' }],
				            [{ 'script': 'sub'}, { 'script': 'super' }],
				            [{ 'indent': '-1'}, { 'indent': '+1' }],
				            [{ 'direction': 'rtl' }],

				            [{ 'size': ['small', false, 'large', 'huge'] }],
				            [{ 'header': [1, 2, 3, 4, 5, 6, false] }],

				            [{ 'color': [] }, { 'background': [] }],
				            [{ 'font': [] }],
				            [{ 'align': [] }],

				            ['clean'],
				            ['image','video','link']
				        ],
				    },
				    theme:'snow'
				},
				htmlTitle: '项目申报',
			};
		},
		methods: {
			///////////////////////////////////////  测试  ////////////////////////////////////////////////
			///////////////////////////////////////结束测试///////////////////////////////////////////////////

			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//                                              															   //
			//                                              工作简历页面													   //
			//                                              															   //
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      getNowFormatDate() {
          var date = new Date();
          var seperator1 = "-";
          var seperator2 = ":";
          var month = date.getMonth() + 1;
          var strDate = date.getDate();
          if (month >= 1 && month <= 9) {
              month = "0" + month;
          }
          if (strDate >= 0 && strDate <= 9) {
              strDate = "0" + strDate;
          }
          var Hours= date.getHours()
          if (Hours >= 0 && Hours <= 9) {
              Hours = "0" + Hours;
          }

          var Minutes= date.getMinutes()
          if (Minutes >= 0 && Minutes <= 9) {
              Minutes = "0" + Minutes;
          }

          var Seconds= date.getSeconds()
          if (Seconds >= 0 && Seconds <= 9) {
              Seconds = "0" + Seconds;
          }
          var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                  + " " + Hours + seperator2 + Minutes
                  + seperator2 + Seconds;
          return currentdate;
      },
      //查看日志放啊
      checkRecord(){
        this.RecordDialog=true
        this.$api.project.getRecordByProId({proId:this.proId}).then((response)=>{
          this.recordData=response.data.data.filter(item=>{
            return item.state==5 || item.state==1
          })
        })
      },
      stateFormat(row,column){
        if(row.state==1){
          return '项目提交'
        }
        if(row.state==2){
          return '学院通过'
        }
        if(row.state==5){
          return '驳回'
        }
        if(row.state==6){
          return '学院不通过'
        }
        if(row.state==-1){
          return '撤销操作'
        }
      },
			//工作简历添加和修改弹窗页面
			resumeAddAndEdit(row) {
				console.log(row)
				if (row) {
					this.dialogResume = true
					this.resumeData.proId=this.proId
					//此处确保el-dialog渲染完再赋值，避免造成数据污染
					this.$nextTick(() => {
						this.resumeData = JSON.parse(JSON.stringify(row))
					});
					// alert("编辑")
				} else {
					this.dialogResume = true
					//在el-dialog渲染完后，才能对form表单赋予初值，此时初值已在mounted生成！
					this.$nextTick(() => {
						this.$refs['resumeData'].resetFields();
						this.resumeData.id = ""
						this.resumeData.teachingId = ""
					});
					// alert("添加")
				}
			},
			//工作简历添加和修改提交按钮
			confirmResumeSubmit() {
				this.$refs['resumeData'].validate((valid) => {
					if (valid) {
						if (this.resumeData.id == null || this.resumeData.id == '') {
							if(this.resumeAllData.length<5){
								console.log(this.resumeData)
								if (this.resumeAllData.length == 0) {
									this.resumeData.id = 1
								} else {
									this.resumeData.id = this.resumeAllData[this.resumeAllData.length - 1].id + 1
								}
								this.resumeData.proId=this.proId
								this.resumeAllData.push(JSON.parse(JSON.stringify(this.resumeData)))
								this.dialogResume = false
								this.$message({
									message: "主要工作简历添加成功!",
									type: "success",
									offset: screen.height / 2 - 100,
									center: true
								})
								// alert("我是新加一个数值")
							}else{
								this.$message({
									message: "工作简历已到最大上限!",
									type: "warning",
									offset: screen.height / 2 - 100,
									center: true
								})
							}

						} else {
							for (let i = 0; i < this.resumeAllData.length; i++) {
								if (this.resumeAllData[i].id == this.resumeData.id) {
									this.resumeAllData[i].teachingDateStart = this.resumeData.teachingDateStart
									this.resumeAllData[i].teachingDateEnd = this.resumeData.teachingDateEnd
									this.resumeAllData[i].teachingCoursename = this.resumeData.teachingCoursename
									this.resumeAllData[i].teachingPrelectobject = this.resumeData.teachingPrelectobject
									this.resumeAllData[i].teachingLearnhour = this.resumeData.teachingLearnhour
									this.resumeAllData[i].teachingDepartment = this.resumeData.teachingDepartment
								}
							}
							// alert("我是编辑一个数值")
							this.dialogResume = false
							this.$message({
								message: "主要工作简历修改成功!",
								type: "success",
								offset: screen.height / 2 - 100,
								center: true
							})
						}
					} else {
						return false
					}
				})
			},
			//删除工作简历按钮
			deleteResume(index, row) {
				console.log(index, row);
				this.$confirm('此操作将永久删除该信息, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning',
					center: true
				}).then(() => {
					//删除语句

					if(this.resumeAllData[index].teachingId!=''){
						this.noIdResumeData.push(this.resumeAllData[index].teachingId)
						console.log(this.noIdResumeData)
					}
					this.resumeAllData.splice(index, 1)
					this.$message({
						type: 'success',
						message: '删除成功!',
						offset: screen.height / 2 - 100
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除',
						offset: screen.height / 2 - 100
					});
				});
			},



			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//                                              															   //
			//                                              科研与教研工作简历页面方法										   //
			//                                              															   //
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			//打开科研与教研工作简历页面弹窗方法
			researchResumeAddAndEdit(row){
				console.log(row)
				if(row){
					//弹窗弹开
					this.dialogResearching=true
					this.$nextTick(()=>{
						//数据回显
						this.ResearchResumeData=JSON.parse(JSON.stringify(row))
						if(row.searchingMaterials!=''){
							var obj	= {}
							this.$set(obj,'name',row.searchingMaterials)
							this.pdffileList.push(obj)
						}

					})
					// alert("修改新值弹窗")
				}else{
					this.dialogResearching=true
					this.$nextTick(()=>{
						this.$refs['ResearchResumeData'].resetFields();
						this.ResearchResumeData.id = ""
						this.ResearchResumeData.searchingId = ""
					})
					// alert("增加新值弹窗")
				}
			},
			//提交或和修改按钮方法
			confirmreSearchResumeSubmit(){
				this.$refs['ResearchResumeData'].validate((valid) => {
					if (valid) {
						if (this.ResearchResumeData.id == null || this.ResearchResumeData.id == '') {
							if(this.ResearchResumeAllData.length <5){
								console.log(this.ResearchResumeData)
								this.ResearchResumeData.proId=this.proId
								if (this.ResearchResumeAllData.length == 0) {
									this.ResearchResumeData.id = 1
								} else {
									this.ResearchResumeData.id = this.ResearchResumeAllData[this.ResearchResumeAllData.length - 1].id + 1
								}
								this.ResearchResumeAllData.push(JSON.parse(JSON.stringify(this.ResearchResumeData)))
								this.pdffileList=[]
								this.dialogResearching = false
								this.$message({
									message: "科研与教研工作简历添加成功!",
									type: "success",
									offset: screen.height / 2 - 100,
									center: true
								})
								// alert("我是新加一个数值")
							}else{
								this.$message({
									message: "科研与教研工作简历已到最大上限!",
									type: "warning",
									offset: screen.height / 2 - 100,
									center: true
								})
							}

						} else {
							for (let i = 0; i < this.ResearchResumeAllData.length; i++) {
								if (this.ResearchResumeAllData[i].id == this.ResearchResumeData.id) {
									this.ResearchResumeAllData[i].searchingDateStart = this.ResearchResumeData.searchingDateStart
									this.ResearchResumeAllData[i].searchingDateEnd = this.ResearchResumeData.searchingDateEnd
									this.ResearchResumeAllData[i].searchingName = this.ResearchResumeData.searchingName
									this.ResearchResumeAllData[i].searchingSource = this.ResearchResumeData.searchingSource
									this.ResearchResumeAllData[i].searchingSearchstatus = this.ResearchResumeData.searchingSearchstatus
									this.ResearchResumeAllData[i].searchingAwards = this.ResearchResumeData.searchingAwards
									this.ResearchResumeAllData[i].searchingMaterials = this.ResearchResumeData.searchingMaterials
								}
							}
							// alert("我是编辑一个数值")
							this.pdffileList=[]
							this.dialogResearching = false
							this.$message({
								message: "科研与教研工作简历修改成功!",
								type: "success",
								offset: screen.height / 2 - 100,
								center: true
							})
						}
					} else {
						return false
					}
				})
			},
			//删除科研与教研工作简历
			deleteResearchResume(index, row) {
				console.log(index, row);
				this.$confirm('此操作将永久删除该信息, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning',
					center: true
				}).then(() => {
					if(this.ResearchResumeAllData[index].searchingId!=''){
						this.deleteResearchResumeId.push(this.ResearchResumeAllData[index].searchingId)
						console.log(this.deleteResearchResumeId)
					}
					this.ResearchResumeAllData.splice(index, 1)
					this.$message({
						type: 'success',
						message: '删除成功!',
						offset: screen.height / 2 - 100
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除',
						offset: screen.height / 2 - 100
					});
				});
			},
			//Pdf上传文件前的操作
			pdfbeforeUpload(file) {
				var testmsg = file.name.substring(file.name.lastIndexOf(".") + 1);
				const extension = testmsg === "pdf";
				if (!extension) {
					this.$message({
						message: "上传文件只能是.pdf格式!",
						type: "warning",
					});
				}
				return extension;
			},
			//Pdf上传成功之后的钩子函数
			pdfUploadSuccess(response) {
				console.log(response.data[0].filePath)
				this.ResearchResumeData.searchingMaterials = response.data[0].filePath
			},


			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//                                              															   //
			//                                              	项目主要成员页面方法										   //
			//                                              															   //
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			//打开项目主要成员页面方法
			mainMemeberAddAndEdit(row){
				console.log(row)
				this.$api.teacher.getAllTeacherInfo({}).then((response)=>{
					this.tableData=response.data.data
				})
				if(row){
					//弹窗弹开
					this.dialogAddNainMember=true
					this.$nextTick(()=>{
						//数据回显
						this.mainMember=JSON.parse(JSON.stringify(row))
						if(row.memberSignature!=''){
							var obj	= {}
							this.$set(obj,'name',row.memberSignature)
							this.pngfileList.push(obj)
						}
					})
					// alert("修改新值弹窗")
				}else{
					this.dialogAddNainMember=true
					this.$nextTick(()=>{
						this.$refs['mainMember'].resetFields();
						this.mainMember.id = ""
						this.mainMember.belong=""
						this.mainMember.memberId=''
						this.mainMember.memberSignature=""
					})
					console.log(this.mainMemberaAll)
					// alert("增加新值弹窗")
				}
			},
			//提交或和修改按钮方法
			confirmreMainMemberSubmit(){
				this.$refs['mainMember'].validate((valid) => {
					if (valid) {
						if (this.mainMember.id == null || this.mainMember.id == '') {
							if(this.mainMemberaAll.length < 5){
								for(let i=0;i<this.mainMemberaAll.length;i++){
									if(this.mainMember.idcard==this.mainMemberaAll[i].idcard){
										this.$message({
											message: "此成员已添加!",
											type: "warning",
											offset: screen.height / 2 - 100,
											center: true
										})
										return
									}
								}
								this.mainMember.proId=this.proId
								console.log(this.mainMember)
								if (this.mainMemberaAll.length == 0) {
									this.mainMember.id = 1
								} else {
									this.mainMember.id = this.mainMemberaAll[this.mainMemberaAll.length - 1].id + 1
								}
								this.mainMemberaAll.push(JSON.parse(JSON.stringify(this.mainMember)))
								this.pngfileList=[]
								this.dialogAddNainMember = false
								this.$message({
									message: "主要成员添加成功!",
									type: "success",
									offset: screen.height / 2 - 100,
									center: true
								})
								// alert("我是新加一个数值")
							}else{
								this.$message({
									message: "主要成员已到最大上限!",
									type: "warning",
									offset: screen.height / 2 - 100,
									center: true
								})
							}


						} else {
							for (let i = 0; i < this.mainMemberaAll.length; i++) {
								if (this.mainMemberaAll[i].id == this.mainMember.id) {
									this.mainMemberaAll[i].memberName = this.mainMember.memberName
									this.mainMemberaAll[i].belong = this.mainMember.belong
									this.mainMemberaAll[i].idcard = this.mainMember.idcard
									this.mainMemberaAll[i].memberTitle = this.mainMember.memberTitle
									this.mainMemberaAll[i].memberJob = this.mainMember.memberJob
									this.mainMemberaAll[i].memberDep = this.mainMember.memberDep
									this.mainMemberaAll[i].memberResearchareas = this.mainMember.memberResearchareas
									this.mainMemberaAll[i].memberDivision = this.mainMember.memberDivision
									this.mainMemberaAll[i].memberSignature = this.mainMember.memberSignature
								}
							}
							// alert("我是编辑一个数值")
							this.pngfileList=[]
							this.dialogAddNainMember = false
							this.$message({
								message: "主要成员修改成功!",
								type: "success",
								offset: screen.height / 2 - 100,
								center: true
							})
						}
					} else {
						return false
					}
				})
			},
			//项目名查重接口
			nameRateAxios() {
				this.$api.project.nameRate({
					//填入变量
					projectName: this.project.pro_name
				}).then((response) => {
					console.log(response.data.data.nameRepetitionRate)
					if (response.data.data.nameRepetitionRate >= 0.5) {
						this.$message({
							message: "项目名称重复过多!",
							type: "warning",
							offset: screen.height / 2 - 100,
							center: true
						})
					}
				})
			},
			TemporaryStorage() {
				// console.log(this.mainMemberaAll)
				// console.log(this.resumeAllData)
				// console.log(this.ResearchResumeAllData)
				this.$confirm('是否要进行暂存操作?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning',
					center: true
				}).then(() => {
					this.TemporaryStorageAxios()
					this.$message({
						message: "暂存成功！",
						type: "success",
						offset: screen.height / 2 - 100,
						center: true
					})
					// this.$router.push({
					// 	path: '/declare'
					// })
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消暂存',
						offset: screen.height / 2 - 100
					});
				});

			},
			Submit() {
				//验证
				this.$refs['project'].validate((valid) => {
					if (valid) {
						for(let i = 0;i < this.ResearchResumeAllData.length;i++){
							if(this.ResearchResumeAllData[i].searchingMaterials==''){
								this.$message({
									message: "请补全科研与科教工作简历!",
									type: "error",
									offset: screen.height / 2 - 100,
									center: true
								})
								return false;
							}
						}

						for(let i = 0;i < this.mainMemberaAll.length;i++){
							if(this.mainMemberaAll[i].memberSignature==''){
								this.$message({
									message: "请补全项目主要成员!",
									type: "error",
									offset: screen.height / 2 - 100,
									center: true
								})
								return false;
							}
						}

						if(this.proAnalysis==''){
							this.$message({
								message: "请补全项目的立项依据和目标!",
								type: "error",
								offset: screen.height / 2 - 100,
								center: true
							})
							return false;
						}
						if(this.proProblem==''){
							this.$message({
								message: "请补全项目的立项依据和目标!",
								type: "error",
								offset: screen.height / 2 - 100,
								center: true
							})
							return false;
						}

						if(this.proExpection==''){
							this.$message({
								message: "请补全项目的立项依据和目标!",
								type: "error",
								offset: screen.height / 2 - 100,
								center: true
							})
							return false;
						}

						if(this.proArrange==''){
							this.$message({
								message: "请补全项目的立项依据和目标!",
								type: "error",
								offset: screen.height / 2 - 100,
								center: true
							})
							return false;
						}

						if(this.proResults==''){
							this.$message({
								message: "请补全项目的立项依据和目标!",
								type: "error",
								offset: screen.height / 2 - 100,
								center: true
							})
							return false;
						}
						//全部通过后
						 this.$confirm('是否要提交该项目?', '提示', {
						          confirmButtonText: '确定',
						          cancelButtonText: '取消',
						          type: 'warning',
						          center: true
						        }).then(() => {
								  this.SubmitAxios()
                    this.$router.push({
                    	path: '/declare'
                    })
						          this.$message({
						            type: 'success',
						            message: '提交成功!'
						          });
                      this.$api.project.creatRecord({
                        gh:this.teacherinfo.gh,
                        name:this.teacherinfo.xm,
                        proId:this.proId,
                        state:1,
                        time:this.getNowFormatDate(),
                        message:'项目提交',
                      }).then((response)=>{
                        console.log(response)
                      })
						        }).catch(() => {
						          this.$message({
						            type: 'info',
						            message: '已取消提交'
						          });
						        });
					} else {
						this.$message({
							message: "请补全基本信息!",
							type: "error",
							offset: screen.height / 2 - 100,
							center: true
						})
						return false;
					}
				});

			},
			//当前行表格向上移动
			upLayer(index, row) {
				console.log(this.mainMemberaAll)
				//定义临时下标，用于获取移动后的下标
				var tempIndex
				var that = this;
				console.log("姓名:" + row.memberName)
				//判断是否在顶部，如果在顶部就没必要减一，直接赋予0
				if (index == 0) {
					tempIndex = index
					console.log("tempIndex:" + tempIndex)
				} else {
					tempIndex = index - 1
					console.log("tempIndex:" + tempIndex)
				}
				//如果此时在第1行
				if (tempIndex == 0) {
					//他就是主持人
					this.mainMemberaAll[index].ranking = 1
					console.log("Ranking:" + this.mainMemberaAll[index].ranking)

				}

				//检查是否有工号，有是学校里的，无是校外的
				if (row.belong == '') {
					//校外
					if (index == 0) {
						that.$message({
							message: "处于顶端，不能继续上移",
							type: "warning",
							offset: screen.height / 2 - 100,
							center: true
						});
					} else {
						//移动
						let upDate = that.mainMemberaAll[index - 1];
						that.mainMemberaAll.splice(index - 1, 1);
						that.mainMemberaAll.splice(index, 0, upDate);
					}
				} else {
					console.log("校内")
					//校内操作
					//检查是否是录入人
					if (this.teacherinfo.gh == row.belong) {
						//如果是让他移动
						if (index == 0) {
							that.$message({
								message: "处于顶端，不能继续上移",
								type: "warning",
								offset: screen.height / 2 - 100,
								center: true
							});
						} else {
							let upDate = that.mainMemberaAll[index - 1];
							that.mainMemberaAll.splice(index - 1, 1);
							that.mainMemberaAll.splice(index, 0, upDate);
						}
					} else {
						//如果不是录入人，检查他的顶部，是否是录入人或者是校外人员，如果是不能往上移动，不是则可以移动
						if (this.mainMemberaAll[index - 1].belong == this.teacherinfo.gh || this.mainMemberaAll[index - 1]
							.belong == "") {
							that.$message({
								message: "该教师不能继续上移",
								type: "warning",
								offset: screen.height / 2 - 100,
								center: true
							});
							return
						} else {
							let upDate = that.mainMemberaAll[index - 1];
							that.mainMemberaAll.splice(index - 1, 1);
							that.mainMemberaAll.splice(index, 0, upDate);
						}
					}
				}
			},
			//当前行表格向下移动
			downLayer(index, row) {
				console.log(this.mainMemberaAll)
				var that = this;
				if (this.teacherinfo.gh == row.belong) {
					if (index + 1 === that.mainMemberaAll.length) {
						that.$message({
							message: "处于末端端，不能继续下移",
							type: "warning",
							offset: screen.height / 2 - 100,
							center: true
						});
						return
					} else {
						if (this.mainMemberaAll[index + 1].belong == "") {
							//不是教师
							console.log(this.mainMemberaAll)
							let downDate = that.mainMemberaAll[index];
							that.mainMemberaAll.splice(index, 1);
							that.mainMemberaAll.splice(index, 0, downDate);
						} else {
							that.$message({
								message: "该教师不能继续下移",
								type: "warning",
								offset: screen.height / 2 - 100,
								center: true
							});
							return
						}
					}

				}
				if (index + 1 === that.mainMemberaAll.length) {
					that.$message({
						message: "处于末端端，不能继续下移",
						type: "warning",
						offset: screen.height / 2 - 100,
						center: true
					});
				} else {
					let downDate = that.mainMemberaAll[index + 1];
					that.mainMemberaAll.splice(index + 1, 1);
					that.mainMemberaAll.splice(index, 0, downDate);
				}
			},
			getNowDate() {
				var nowDate = new Date();
				var year = nowDate.getFullYear();
				var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
				var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
				var dateStr = year + "-" + month
				this.nowDate = dateStr
				console.log("现在日期：" + this.nowDate)
			},
			//Png上传文件前的操作
			pngbeforeUpload(file) {
				var testmsg = file.name.substring(file.name.lastIndexOf(".") + 1);
				const extension = testmsg === "png";
				if (!extension) {
					this.$message({
						message: "上传文件只能是.png格式!",
						type: "warning",
						offset: screen.height / 2 - 100,
						center: true
					});
				}
				return extension;
			},
			//Png上传成功之后的钩子函数
			pngUploadSuccess(response) {
				console.log(response.data[0].filePath)
				this.mainMember.memberSignature = response.data[0].filePath
			},
			TemporaryStorageAxios() {
				var that = this
				var resumeDateId=[]
				var ResumeDateNoId=[]
				//拆开数组有teachingid的做修改，没有做新加
				for (let i = 0; i < that.resumeAllData.length; i++) {
					that.resumeAllData[i].teachingDate = that.resumeAllData[i].teachingDateStart + '--' + that
						.resumeAllData[i].teachingDateEnd
						if(that.resumeAllData[i].teachingId==''){
							ResumeDateNoId.push(that.resumeAllData[i])
						}else{
							resumeDateId.push(that.resumeAllData[i])
						}
				}
				//新加操作
				this.$api.project.insertProjectTeaching({
						projectTeachings:JSON.stringify(ResumeDateNoId)
				}).then((response)=>{
					console.log(response)
				})

				//有teachingid的，需要做删除处理的，做删除操作
				for(let i = 0; i<this.deleteMainMemberaId.length;i++){
					this.$api.project.deleteProjectMember({
						member_id:this.deleteMainMemberaId[i]
					})
				}


				var ResearchResumeDataId=[]
				var ResearchResumeDataNoId=[]
				for (let i = 0; i < that.ResearchResumeAllData.length; i++) {
					//拼接字符串，做时间
					that.ResearchResumeAllData[i].searchingDate = that.ResearchResumeAllData[i].searchingDateStart + '--' + that
						.ResearchResumeAllData[i].searchingDateEnd
						if(that.ResearchResumeAllData[i].searchingId==''){
							ResearchResumeDataNoId.push(that.ResearchResumeAllData[i])
						}else{
							ResearchResumeDataId.push(that.ResearchResumeAllData[i])
						}
				}
				this.$api.project.insertProjectSearching({
					projectSearchings:JSON.stringify(ResearchResumeDataNoId)
				}).then((resopnse)=>{
					console.log(resopnse)
				})

				//有teachingid的，需要做删除处理的，做删除操作
				for(let i = 0; i<this.deleteResearchResumeId.length;i++){
					this.$api.project.deleteProjectSearchingBySearchingId({
						searching_id:this.deleteResearchResumeId[i]
					}).then((item)=>{
						console.log(item)
					})
				}

				var mainMemberDataId=[]
				var mainMemberDataNoId=[]
				for (let i = 0; i < that.mainMemberaAll.length; i++) {
						if(that.mainMemberaAll[i].memberId==''){
							mainMemberDataNoId.push(that.mainMemberaAll[i])
						}else{
							mainMemberDataId.push(that.mainMemberaAll[i])
						}
				}
				this.$api.project.insertProjectMember({
					projectMembers:JSON.stringify(mainMemberDataNoId)
				}).then((resopnse)=>{
					console.log(resopnse)
				})

				//有deleteResearchResumeId的，需要做删除处理的，做删除操作
				for(let i = 0; i<this.deleteResearchResumeId.length;i++){
					this.$api.project.deleteProjectSearchingBySearchingId({
						searching_id:this.deleteResearchResumeId[i]
					}).then((item)=>{
						console.log(item)
					})
				}



				for(let i = 0;i<this.mainMemberaAll.length;i++){
					this.mainMemberaAll[i].ranking=i+1
				}

        this.project.pro_dep_id=this.departments.find(item=> item.depName==this.project.pro_department).depId
				this.$api.project.updateProject({
					//项目类别
					proCategory: this.proCategory,
					//项目申报人所在部门
					proDepartment: this.project.pro_department,
					//项目申报人所在部门编号
					proDepId:this.project.pro_dep_id,
					//项目预留邮箱
					proEmail: this.project.pro_email,
					//项目结束时间(yyyy-MM)
					proEnddate: this.project.pro_enddate,
					projectMembers: JSON.stringify(resumeDateId),
					projectSearchings: JSON.stringify(ResearchResumeDataId),
					projectTeachings: JSON.stringify(mainMemberDataId),
					proName: this.project.pro_name,
					proPhone: this.project.pro_phone,
					proStartdate: this.nowDate,
					proTelephone: this.project.pro_telephone,
					batchId: this.batch_id,
					proId:this.proId,
					proAnalysis: this.proAnalysis,
					proProblem: this.proProblem,
					proExpection: this.proExpection,
					proArrange: this.proArrange,
					proResults: this.proResults,
					proApproval:0,
					levelId:this.project.level_id[this.project.level_id.length-1],
					classification:this.project.pro_classification
				}).then((resopnse) => {
					console.log(resopnse)
				})
			},
			SubmitAxios() {
				var that = this
				var resumeDateId=[]
				var ResumeDateNoId=[]
				//拆开数组有teachingid的做修改，没有做新加
				for (let i = 0; i < that.resumeAllData.length; i++) {
					that.resumeAllData[i].teachingDate = that.resumeAllData[i].teachingDateStart + '--' + that
						.resumeAllData[i].teachingDateEnd
						if(that.resumeAllData[i].teachingId==''){
							ResumeDateNoId.push(that.resumeAllData[i])
						}else{
							resumeDateId.push(that.resumeAllData[i])
						}
				}
				//新加操作
				this.$api.project.insertProjectTeaching({
						projectTeachings:JSON.stringify(ResumeDateNoId)
				}).then((response)=>{
					console.log(response)
				})

				//有teachingid的，需要做删除处理的，做删除操作
				for(let i = 0; i<this.deleteMainMemberaId.length;i++){
					this.$api.project.deleteProjectMember({
						member_id:this.deleteMainMemberaId[i]
					})
				}


				var ResearchResumeDataId=[]
				var ResearchResumeDataNoId=[]
				for (let i = 0; i < that.ResearchResumeAllData.length; i++) {
					//拼接字符串，做时间
					that.ResearchResumeAllData[i].searchingDate = that.ResearchResumeAllData[i].searchingDateStart + '--' + that
						.ResearchResumeAllData[i].searchingDateEnd
						if(that.ResearchResumeAllData[i].searchingId==''){
							ResearchResumeDataNoId.push(that.ResearchResumeAllData[i])
						}else{
							ResearchResumeDataId.push(that.ResearchResumeAllData[i])
						}
				}
				this.$api.project.insertProjectSearching({
					projectSearchings:JSON.stringify(ResearchResumeDataNoId)
				}).then((resopnse)=>{
					console.log(resopnse)
				})

				//有teachingid的，需要做删除处理的，做删除操作
				for(let i = 0; i<this.deleteResearchResumeId.length;i++){
					this.$api.project.deleteProjectSearchingBySearchingId({
						searching_id:this.deleteResearchResumeId[i]
					}).then((item)=>{
						console.log(item)
					})
				}

				var mainMemberDataId=[]
				var mainMemberDataNoId=[]
				for (let i = 0; i < that.mainMemberaAll.length; i++) {
						if(that.mainMemberaAll[i].memberId==''){
							mainMemberDataNoId.push(that.mainMemberaAll[i])
						}else{
							mainMemberDataId.push(that.mainMemberaAll[i])
						}
				}
				this.$api.project.insertProjectMember({
					projectMembers:JSON.stringify(mainMemberDataNoId)
				}).then((resopnse)=>{
					console.log(resopnse)
				})

				//有teachingid的，需要做删除处理的，做删除操作
				for(let i = 0; i<this.deleteResearchResumeId.length;i++){
					this.$api.project.deleteProjectSearchingBySearchingId({
						searching_id:this.deleteResearchResumeId[i]
					}).then((item)=>{
						console.log(item)
					})
				}



				for(let i = 0;i<this.mainMemberaAll.length;i++){
					this.mainMemberaAll[i].ranking=i+1
				}


				this.$api.project.updateProject({
					//项目类别
					proCategory: this.proCategory,
					//项目申报人所在部门
					proDepartment: this.project.pro_department,
					//项目申报人所在部门编号
					proDepId:this.project.pro_dep_id,
					//项目预留邮箱
					proEmail: this.project.pro_email,
					//项目结束时间(yyyy-MM)
					proEnddate: this.project.pro_enddate,
					projectMembers: JSON.stringify(resumeDateId),
					projectSearchings: JSON.stringify(ResearchResumeDataId),
					projectTeachings: JSON.stringify(mainMemberDataId),
					proName: this.project.pro_name,
					proPhone: this.project.pro_phone,
					proStartdate: this.nowDate,
					proTelephone: this.project.pro_telephone,
					batchId: this.batch_id,
					proId:this.proId,
					proAnalysis: this.proAnalysis,
					proProblem: this.proProblem,
					proExpection: this.proExpection,
					proArrange: this.proArrange,
					proResults: this.proResults,
					proApproval:1,
					levelId:this.project.level_id[this.project.level_id.length-1],
					classification:this.project.pro_classification
				}).then((resopnse) => {
					console.log(resopnse)
          this.$store.commit('getTodoList')
				})
			},
			getDataAxios() {
				//通过导航栏传递BatchId
				this.batch_id = this.$route.query.batch_id;
				this.batchLevelId = this.$route.query.level_id;
				this.proId=this.$route.query.projectId
				console.log(this.proId)
				//得到该教师最近的申报的项目信息
				this.$api.project.getProjectById({
					proId:this.proId
				}).then((response) => {
					console.log(response)
					//接受基本信息
					var projectTemp=response.data.data.project
					//填充基本信息
					this.project.pro_name=projectTemp.proName
          this.proApproval=projectTemp.proApproval
					//填充所属学院
					this.$api.department.getSchoolDepartments({}).then((response) => {
            console.log(response)
						this.departments=response.data.data.departments
						if(this.departments.find((item)=>item.depName==projectTemp.proDepartment)){
							console.log(this.departments)
							this.project.pro_department=this.departments.find((item)=>item.depName==projectTemp.proDepartment).depName
							this.project.pro_dep_id=this.departments.find((item)=>item.depName==projectTemp.proDepartment).depId
						}
					})
					//填充项目类别
					this.$api.Level.getAllLevel()
						.then((response) => {
              console.log(response)
							var LvId = response.data.data.filter((item) => {
								return item.levelId == this.batchLevelId
							})
              console.log(LvId)
							this.levelOptions = this.getTreeData(LvId)
							this.project.level_id=this.changeDetSelect(projectTemp.levelId,this.levelOptions)
						})
					//所属分组
					var tempClass= this.$route.query.classify.split(",")
					tempClass.forEach((item)=>{
						var obj ={}
						this.$set(obj,"classify_name",item)
						this.classification.push(obj)
					})
					//填充分组信息
					this.project.pro_classification=projectTemp.classification
					//结束时间
					this.project.pro_enddate=projectTemp.proEnddate
					//填充Email
					this.project.pro_email = projectTemp.proEmail
					//填充电话
					this.project.pro_telephone=parseInt(projectTemp.proTelephone)
					//填充手机
					this.project.pro_phone=parseInt(projectTemp.proPhone)
					//接收工作简历
					var teachings=response.data.data.teachings
					console.log(teachings)
					for (let i = 0; i <teachings.length; i++) {
						//填充工作简历
						var temp = teachings[i].teachingDate.split("--")
						this.resumeData.teachingDateStart = temp[0]
						this.resumeData.teachingDateEnd = temp[1]
						this.resumeData.id = i + 1
						this.resumeData.teachingId=teachings[i].teachingId
						this.resumeData.teachingCoursename = teachings[i].teachingCoursename
						this.resumeData.teachingPrelectobject = teachings[i].teachingPrelectobject
						this.resumeData.teachingLearnhour = parseInt(teachings[i].teachingLearnhour)
						this.resumeData.teachingDepartment = teachings[i].teachingDepartment
						this.resumeAllData.push(JSON.parse(JSON.stringify(this.resumeData)))
					}
					Object.keys(this.resumeData).forEach(key => {this.resumeData[key] = ''})

					var searchings=response.data.data.searchings
					console.log(searchings)
					for (let i = 0; i < searchings.length; i++) {
						//填充科研与教研工作简历
						var tempRes = searchings[i].searchingDate.split("--")
						this.ResearchResumeData.searchingDateStart = tempRes[0]
						this.ResearchResumeData.searchingDateEnd = tempRes[1]
						this.ResearchResumeData.id = i+1
						this.ResearchResumeData.searchingId= searchings[i].searchingId
						this.ResearchResumeData.searchingName = searchings[i].searchingName
						this.ResearchResumeData.searchingSource = searchings[i].searchingSource
						this.ResearchResumeData.searchingSearchstatus = searchings[i].searchingSearchstatus
						this.ResearchResumeData.searchingMaterials = searchings[i].searchingMaterials
						this.ResearchResumeData.searchingAwards = searchings[i].searchingAwards
						this.ResearchResumeAllData.push(JSON.parse(JSON.stringify(this.ResearchResumeData)))
					}
					Object.keys(this.ResearchResumeData).forEach(key => {this.ResearchResumeData[key] = ''})


					//填充主持人信息
						var  members=response.data.data.members
						for (let i = 0; i < members.length; i++) {
							//填充科研与教研工作简历
							this.mainMember.id = i+1
							this.mainMember.memberId= members[i].memberId
							this.mainMember.memberName= members[i].memberName
							this.mainMember.belong = members[i].belong
							this.mainMember.idcard = members[i].idcard
							this.mainMember.memberTitle = members[i].memberTitle
							this.mainMember.memberJob = members[i].memberJob
							this.mainMember.memberDep = members[i].memberDep
							this.mainMember.memberResearchareas = members[i].memberResearchareas
							this.mainMember.memberDivision = members[i].memberDivision
							this.mainMember.memberSignature = members[i].memberSignature
							this.mainMember.ranking = members[i].ranking
							this.mainMemberaAll.push(JSON.parse(JSON.stringify(this.mainMember)))
						}
						Object.keys(this.mainMember).forEach(key => {this.mainMember[key] = ''})
					//填充立项依据和目标
							this.proAnalysis=projectTemp.proAnalysis
							this.proProblem=projectTemp.proProblem
							this.proExpection=projectTemp.proExpection
							this.proArrange=projectTemp.proArrange
							this.proResults=projectTemp.proResults
              this.getSex()
				})
			},
			//得到项目类别的树形结构
			getTreeData(data) {
				// 循环遍历json数据
				for (var i = 0; i < data.length; i++) {
					if (data[i].children.length < 1) {
						// children若为空数组，则将children设为undefined
						data[i].children = undefined;
					} else {
						// children若不为空数组，则继续 递归调用 本方法
						this.getTreeData(data[i].children);
					}
				}
				return data;
			},
			RemovePdf(file, fileList) {
				this.ResearchResumeData.searchingMaterials=''
				console.log(file, fileList);
			},
			RemovePng(file, fileList) {
				this.mainMember.memberSignature=''
				console.log(file, fileList);
			},
			handlePreview(file) {
				console.log(file);
			},
			handleExceed(files, fileList) {
				this.$message.warning(`当前限制选择 1 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
			},
			beforeRemove(file, fileList) {
				return this.$confirm(`确定移除 ${ file.name }？`);
			},
			resetForm(formName) { //重置input
				this.$refs[formName].resetFields();
			},
			submitForm(formName) {
				this.$refs[formName].validate((valid) => {
					if (valid) {
						// alert('submit!');
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			//删除主要成员行
			DeleteMainMember(index, row) {
				this.$confirm('此操作将永久删除该信息, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning',
					center: true
				}).then(() => {
					if(this.mainMemberaAll[index].idcard==this.teacherinfo.sfzh){
						this.$message({
							type: 'warning',
							message: '此成员不可删除!',
							offset: screen.height / 2 - 100,
							center:true
						});
						return
					}
					if(this.mainMemberaAll[index].memberId!=''){
						this.deleteMainMemberaId.push(this.mainMemberaAll[index].memberId)
					}
					this.mainMemberaAll.splice(index, 1)
					this.$message({
						type: 'success',
						message: '删除成功!',
						offset: screen.height / 2 - 100
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除',
						offset: screen.height / 2 - 100
					});
				})
			},
			//点击添加按钮进行添加老师操作
			addTeacherToForm(index, row) {
				console.log(row)
				this.mainMember.memberName = row.xm
				this.mainMember.belong = row.gh
				this.mainMember.memberDep = row.bm
				this.mainMember.idcard = row.sfzh
				this.mainMember.memberTitle = row.xpprzc
				this.mainMember.memberJob = row.jtgw
			},
			handleEdit(index, row) {
				console.log(index, row);
			},
			handleDelete(index, row) {
				console.log(index, row);
				var index
				for (let i = 0; i < this.resumeAllData.length; i++) {
					if (this.resumeAllData[i].id == row.id) {
						index = i;
						break;
					}
				}
				this.resumeAllData.splice(index, 1)
			},
			handleClick(tab, event) {
				console.log(tab, event);
			},
			//根据id回显级联选择器
			changeDetSelect(key,treeData){
			let arr = []; // 在递归时操作的数组
			let returnArr = []; // 存放结果的数组
			let depth = 0; // 定义全局层级
			// 定义递归函数
			function childrenEach(childrenData, depthN) {
			    for (var j = 0; j < childrenData.length; j++) {
			        depth = depthN; // 将执行的层级赋值 到 全局层级
			        arr[depthN] = (childrenData[j].levelId);
			        if (childrenData[j].levelId == key) {
			            returnArr = arr.slice(0, depthN+1); //将目前匹配的数组，截断并保存到结果数组，
			            break
			        } else {
			            if (childrenData[j].children) {
			                depth ++;
			                childrenEach(childrenData[j].children, depth);
			            }
			        }
			    }
			    return returnArr;
			}
			return childrenEach(treeData, depth);
			},
			getSex() {
				if (parseInt(this.mainMemberaAll[0].idcard.substr(16, 1)) % 2 == 1) {
					this.Sex = "男"
				} else {
					this.Sex = "女"
				}
			},
			getAge(UUserCard) {
				let myDate = new Date();
				let month = myDate.getMonth() + 1;
				let day = myDate.getDate();
				let age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
				if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
					age++;
				}
				return age;
			},
			getCategory() {
				if (this.project.level_id[this.project.level_id.length - 1] == 1) {
					this.projectCategory = "一般项目";
				} else if (this.project.level_id[0] == 2) {
					if (this.project.level_id[1] == 4) {
						if (this.project.level_id[2] == 8) {
							this.projectCategory = "课程思政专项/一般项目/课程层面";
						} else if (this.project.level_id[2] == 9) {
							this.projectCategory = "课程思政专项/一般项目/专业层面";
						}else if (this.project.level_id[2] == 10) {
							this.projectCategory = "课程思政专项/一般项目/学校层面";
						} else {
							console.log("无效的选项");
							this.projectCategory = "";
						}
					} else if (this.project.level_id[1] == 5) {
						if (this.project.level_id[2] == 11) {
							this.projectCategory = "课程思政专项/重点项目/课程层面";
						} else if (this.project.level_id[2] == 12) {
							this.projectCategory = "课程思政专项/重点项目/专业层面";
						}else if (this.project.level_id[2] == 13) {
							this.projectCategory = "课程思政专项/重点项目/学校层面";
						} else {
							console.log("无效的选项");
							this.projectCategory = "";
						}
					}
				} else if (this.project.level_id[0] == 3) {
					if (this.project.level_id[1] == 6) {
						this.projectCategory = "重点项目/委托项目";
					} else if (this.project.level_id[1] == 7) {
						this.projectCategory = "重点项目/招标项目";
					} else {
						console.log("无效的选项");
						this.projectCategory = "";
					}
				} else {
					console.log("无效的选项");
					this.projectCategory = "";
				}
				return this.projectCategory;
			},
		},
	};
</script>
<style scoped>
	#btn {
		float: right;
	}

	#RichText {
		width: 70%;
		margin: 0 auto;
		/* position: relative;
		left: 50%;
		transform: translateX(-50%); */
	}

	#projectForm {
		width: 600px;
		margin: 0 auto;
		/*  position: relative;
  left: 50%;
  transform: translateX(-50%); */
	}

	#ResumeForm {
		width: 70%;
		position: relative;
		left: 50%;
		transform: translateX(-50%);
	}

	.el-input {
		width: 90%;
	}

	.el-select {
		width: 90%;
	}

	.dialogMainMember {
		width: 80%;
	}
</style>
